Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Optional Functions

Based on the type of device your component supports, you may have to implement functions other than those listed in "Required Functions," and you may have to set some of your component's capability flags. Read this section to learn which additional functions your component needs to support and how to set your capability flags properly.

If your component does not support a particular function, be sure to return a result code value of digiUnimpErr .

Hardware support for the simultaneous capture and display of frames on the screen is called playthrough in these sections.

Frame Grabbers Without Playthrough

Suppose your video digitization hardware grabs frames but cannot simultaneously display the frames on the screen. Suppose also that your hardware supplies the grabbed frames in QuickDraw pixel maps at specific pixel depths (say, 16 and 32 bits per pixel). For details on QuickDraw pixel maps, see the chapter "Basic QuickDraw" in Inside Macintosh: Imaging .

In this case, you should set the following component capability flags:

digiOutDoes16
Set this flag to 1.
digiOutDoes32
Set this flag to 1.
Set other depth flags to 0.
digiOutDoesHWPlayThru
Set this flag to 0.
digiOutDoesDMA
Set this flag to 0.

If your component can operate asynchronously, you should also set the following flag:

digiOutDoesAsyncGrabs
Set this flag to 1 if your component can operate asynchronously.

Frame grabbers that support asynchronous operation must support the following optional functions:

VDDone

VDGrabOneFrameAsync

VDReleaseAsyncBuffers

VDSetupBuffers

Frame Grabbers With Hardware Playthrough

If your frame grabber hardware provides support for playing the captured images directly, you need to support one additional function beyond those discussed in "Frame Grabbers Without Playthrough." The VDSetPlayThruOnOff function (described on VDSetPlayThruOnOff ) allows the application to turn playthrough on and off.

You should also set the digiOutDoesHWPlayThru capability flag (described on digiOutDoesHWPlayThru ) to 1. In addition, be sure to use the gdh field in the digitizer information structure to identify your component's display device. For details on the video digitizer information structure, see The Digitizer Information Structure .

Key Color and Alpha Channel Devices

As a further elaboration on a basic frame grabber, your device could support the display or mixing of output data via an alpha channel or through the use of key colors (see "Types of Video Digitizer Components" for more information about alpha channels and key colors). In either case, image data cannot be read directly from the screen. Therefore, you must set the digiOutDoesUnreadableScreenBits capability flag to 1. For more on the video digitizer capability flags, see "Capability Flags," .

Your component must load its alpha channel or fill in the key color whenever playthrough is enabled or when the destination changes.

Compressed Source Devices

You may create a video digitizer component that supports a device that delivers compressed image data. In this case, your component is not capable of displaying the data directly.

Your component should set the following capability flags:

digiOutDoesCompress
Set this flag to 1.
digiOutDoesCompressOnly
Set this flag to 1 if your component cannot display the images directly.
digiOutDoesPlayThruDuringCompress
Set this flag to 1 if your component cannot display the images directly.

In addition, frame grabbers that support compressed source devices must support the following optional functions:

VDCompressDone

VDCompressOneFrameAsync

VDGetCompressionTypes

VDGetDataRate

VDGetImageDescription

VDResetCompressSequence

VDSetCompression

VDSetCompressionOnOff

VDSetFrameRate

VDSetTimeBase

If your hardware generates compressed data that cannot be decompressed by any standard QuickTime image decompressor components, be sure to provide an appropriate decompressor component so that the data you provide can be displayed.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next